package com.yl.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yl.dao.IOrderDetailsDao;
import com.yl.model.OrderDetails;

@Service
public class OrderDetailsService implements IOrderDetailsService {

	@Resource
	private IOrderDetailsDao orderDetailsDAO;
	
	/**
	 *后台订单详情
	 */
	@Override
	public Map findByOID(int orders_id) {
		List<OrderDetails> list = orderDetailsDAO.findByOID(orders_id);
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("code", 0);
		map.put("msg", "查询成功");
		map.put("count", list.size());
		map.put("data", list);
		return map;
	}

	/**
	 *前台添加订单详情
	 */
	@Override
	public int addOrderDetail(OrderDetails od) {
		return orderDetailsDAO.addOrderDetail(od);
	}
}
